package gdut.imis.controller;

import gdut.imis.Utils.Result;
import gdut.imis.domain.StudentGrade;
import gdut.imis.service.StudentGradeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author JiaFu
 * @Date 2023/4/8 19:18
 */
@RestController
@RequestMapping("/student-grade")
@Api(value = "学生成绩档案接口", tags = {"学生成绩档案接口"})
@RequiredArgsConstructor
public class StudentGradeController extends BaseController {
    private final StudentGradeService studentGradeService;

    @ApiOperation("新增学生成绩档案")
    @PostMapping("/addStudentGrade")
    @PreAuthorize("@cp.hasPermission('studentGrade')")
    public Result addStudentGrade(@RequestBody StudentGrade studentGrade) {
        return studentGradeService.addStudentGrade(studentGrade);
    }

}
